import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders';
import { defineConfig, presetAttributify, presetIcons, presetUno, transformerAttributifyJsx } from 'unocss';

import { svgTransform } from './internals/svgTransform';

export default defineConfig({
  transformers: [transformerAttributifyJsx()],
  presets: [
    presetUno({}),
    presetAttributify({
      prefix: 'un-',
    }),
    presetIcons({
      autoInstall: true,
      collections: {
        custom: FileSystemIconLoader('./icons', (svg) => svgTransform(svg)),
      },
    }),
  ],
});
